/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxline.model;

import br.com.foxline.enums.Status;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;

/**
 *
 * @author ely
 * 
 * Lote
 */
@Entity
public class Lot implements Serializable{
    
    @Id
    @SequenceGenerator(sequenceName = "seq_lot", name = "seq_lot", allocationSize = 1)
    @GeneratedValue(generator = "seq_lot", strategy = GenerationType.SEQUENCE)
    private Long id;
    
    private String block; // quadra
    
    private Integer num;
    
    private String dimession;
    
    private Double dimessionX;
    
    private Double dimessionY;
    
    private String pathId;
    
    @ManyToOne(fetch= FetchType.LAZY)
    private TypeLot typeLot; 
    
    @Column(scale= 4, precision=10)
    @DecimalMin( value = "0.00" )
    @Digits( fraction = 4, integer = 10 )
    private BigDecimal area;
    
    @Column(scale= 4, precision=19)
    @DecimalMin( value = "0.00" )
    @Digits( fraction = 4, integer = 10 )
    private BigDecimal valueMetre;  // Valor por Metro Quadrado
    
    @Column(scale= 2, precision=19)
    @DecimalMin( value = "0.00" )
    @Digits( fraction = 4, integer = 10 )
    private BigDecimal sees; // avista (valor total)
    
    @Column(scale= 2, precision=19)
    @DecimalMin( value = "0.00" )
    @Digits( fraction = 2, integer = 10 )
    private BigDecimal valueBegin; // Valor Entrada
    
    @OneToMany
    private List<ValueInterestParcel> valueInterestParcels;
    
    @OneToOne
    private GeoLocation geoLocation;
    
    @Enumerated(EnumType.STRING)
    private Status status;
    
    @ManyToOne
    private Enterprise enterprise;

    public Lot() {
    }

    public Lot(String block, Integer num, String dimession, Double dimessionX, Double dimessionY, TypeLot typeLot, BigDecimal area, BigDecimal valueMetre, BigDecimal sees, BigDecimal valueBegin, List<ValueInterestParcel> valueInterestParcels, GeoLocation geoLocation, Status status, Enterprise enterprise) {
        this.block = block;
        this.num = num;
        this.dimession = dimession;
        this.dimessionX = dimessionX;
        this.dimessionY = dimessionY;
        this.typeLot = typeLot;
        this.area = area;
        this.valueMetre = valueMetre;
        this.sees = sees;
        this.valueBegin = valueBegin;
        this.valueInterestParcels = valueInterestParcels;
        this.geoLocation = geoLocation;
        this.status = status;
        this.enterprise = enterprise;
    }

    
    
    public TypeLot getTypeLot() {
        return typeLot;
    }

    public void setTypeLot(TypeLot typeLot) {
        this.typeLot = typeLot;
    }

    
    public Double getDimessionX() {
        return dimessionX;
    }

    public void setDimessionX(Double dimessionX) {
        this.dimessionX = dimessionX;
    }

    public Double getDimessionY() {
        return dimessionY;
    }

    public void setDimessionY(Double dimessionY) {
        this.dimessionY = dimessionY;
    }

    
    public BigDecimal getArea() {
        return area;
    }

    public void setArea(BigDecimal area) {
        this.area = area;
    }

    public String getBlock() {
        return block;
    }

    public void setBlock(String block) {
        this.block = block;
    }

    public String getDimession() {
        return dimession;
    }

    public void setDimession(String dimession) {
        this.dimession = dimession;
    }

    public Enterprise getEnterprise() {
        return enterprise;
    }

    public void setEnterprise(Enterprise enterprise) {
        this.enterprise = enterprise;
    }

    public GeoLocation getGeoLocation() {
        return geoLocation;
    }

    public void setGeoLocation(GeoLocation geoLocation) {
        this.geoLocation = geoLocation;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public BigDecimal getSees() {
        return sees;
    }

    public void setSees(BigDecimal sees) {
        this.sees = sees;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public BigDecimal getValueBegin() {
        return valueBegin;
    }

    public void setValueBegin(BigDecimal valueBegin) {
        this.valueBegin = valueBegin;
    }

    public List<ValueInterestParcel> getValueInterestParcels() {
        return valueInterestParcels;
    }

    public void setValueInterestParcels(List<ValueInterestParcel> valueInterestParcels) {
        this.valueInterestParcels = valueInterestParcels;
    }

    public BigDecimal getValueMetre() {
        return valueMetre;
    }

    public void setValueMetre(BigDecimal valueMetre) {
        this.valueMetre = valueMetre;
    }

    @Override
    public String toString() {
        return "Lot{" + "id=" + id + ", block=" + block + ", num=" + num + ", dimession=" + dimession + ", dimessionX=" + dimessionX + ", dimessionY=" + dimessionY + ", typeLot=" + typeLot + ", area=" + area + ", valueMetre=" + valueMetre + ", sees=" + sees + ", valueBegin=" + valueBegin + ", valueInterestParcels=" + valueInterestParcels + ", geoLocation=" + geoLocation + ", status=" + status + ", enterprise=" + enterprise + '}';
    }

    public String getPathId() {
        return pathId;
    }

    public void setPathId(String pathId) {
        this.pathId = pathId;
    }
    
    
            
    
    
}
